<template>
	<view class="flex flex-js-sb font-size-14">
		<view class="ptb-6 plr-8 bg-color-white br-4 item" :class="{active:value==1}" @click="cahngeType(1)">当前寄售</view>
		<view class="ptb-6 plr-8 bg-color-white br-4 item flex flex-ai-center" :class="{active:value==2}" @click="cahngeType(2)"> <w-icon v-if="product.entrust_status" name="goods_hot" class="mr-4" size="16"></w-icon> 当前委托</view>
		<view class="ptb-6 plr-8 bg-color-white br-4 item flex flex-ai-center" :class="{active:value==3}" @click="cahngeType(3)"> <w-icon v-if="product.is_buy" name="goods_hot" class="mr-4" size="16"></w-icon> 当前竞价</view>
		<view class="ptb-6 plr-8 bg-color-white br-4 item" :class="{active:value==4}" @click="cahngeType(4)">当前成交</view>
	</view>
</template>

<script>
	export default {
		name: "MarketTypeNewTab",
		props: {
			value: {
				type: [Number,String],
				default: 1
			},
			// marketCount: {
			// 	type: Number,
			// 	default: 0
			// },
			// buyCount: {
			// 	type: Number,
			// 	default: 0
			// },
			product: {
				type: Object,
				default () {
					return {}
				}
			},
		},
		model: {
			prop: 'value',
			event: "change"
		},
		methods: {
			cahngeType(v) {
				this.$emit('change', v)
			}
		}
	}
</script>

<style lang="scss" scoped>
	.item {
		border: 2rpx solid transparent;
	}

	.active {
		border: 2rpx solid #C18200;
	}
</style>